/*
 * $Id$
 *
 * Copyright (C) IUT Montreuil-University Paris 8, 2009-2010
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 */

package fr.univ_paris8.iut.linc.align;


public class Edge {


private Concept source;
private Concept target;
private String simpleType;
private Property compoundType;

public Edge(Concept source, Concept target, String simpleType,
		Property compoundType) {
	//super();
	this.source = source;
	this.target = target;
	this.simpleType = simpleType;
	this.compoundType = compoundType;
}

public Concept getSource() {
	return source;
}

public void setSource(Concept source) {
	this.source = source;
}

public Concept getTarget() {
	return target;
}

public void setTarget(Concept target) {
	this.target = target;
}

public String getSimpleType() {
	return simpleType;
}

public void setSimpleType(String simpleType) {
	this.simpleType = simpleType;
}

public Property getCompoundType() {
	return compoundType;
}

public void setCompoundType(Property compoundType) {
	this.compoundType = compoundType;
}

@Override
public boolean equals(Object obj) {
	if (this == obj)
		return true;
	if (obj == null)
		return false;
	if (getClass() != obj.getClass())
		return false;
	Edge other = (Edge) obj;
	if (compoundType == null) {
		if (other.compoundType != null)
			return false;
	} else if (!compoundType.equals(other.compoundType))
		return false;
	if (simpleType == null) {
		if (other.simpleType != null)
			return false;
	} else if (!simpleType.equals(other.simpleType))
		return false;
	if (source == null) {
		if (other.source != null)
			return false;
	} else if (!source.equals(other.source))
		return false;
	if (target == null) {
		if (other.target != null)
			return false;
	} else if (!target.equals(other.target))
		return false;
	return true;
}

@Override
public String toString() {
	return "Edge [S=" + source.getName() + ", T=" + target.getName()
			+ ", ST=" + simpleType + ", CT="
			+ compoundType + "]";
}

}
